const infoStack = (stack,originLog)=>{


    const stackStuff = stack.replace('at ', '').trim().split('\n')[0];
    const stackPath = stackStuff.indexOf('(')>-1 
        ?stackStuff?.split('(')[1].split(')')[0].replaceAll('\\', '/').trim()
        :stackStuff.replaceAll('\\', '/').trim();
    const stackHandle = stackStuff.split('(')[0].replace('at ', '').trim();
    const stackStuffArr = stackPath.split('/');
    const stackFile = stackStuffArr[stackStuffArr.length - 1].trim();
        
    return {
        origin:stack,
        stackFile,
        stackPath,
        stackStuff,
        stackHandle 
    }
}


module.exports={infoStack}